package com.foodplus.www.model.impl;

import com.foodplus.www.api.RetrofitManager;
import com.foodplus.www.bean.good.GoodBean;
import com.foodplus.www.bean.good.siplegood.SipleGoodBean;
import com.foodplus.www.model.IGoodModel;

import java.util.Map;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by WangZhiChao on 2016/10/31.
 */

public class GoodModelImpl implements IGoodModel{
    @Override
    public void getGoodData(Subscriber<GoodBean> subscriber, Map<String, String> params) {
        RetrofitManager
                .getInstance()
                .getGoodService()
                .getGoodData(params)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public void getSipleGoodData(Subscriber<SipleGoodBean> subscriber, Map<String, String> params) {
        RetrofitManager
                .getInstance()
                .getGoodService()
                .getSigleGoodData(params)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }
}
